BigDFT.Interop.RDKitInterop module

This module contains some wrappers for using OpenBabel to perform various operations with RDKit.


Convert a BigDFT system to rdkit molecule.


sys (BigDFT.Systems.System) – the system to convert.


an rdkit type molecule.

Return type:


compute_rdkit_matching(sys, rdsys, check_matching=True)[source]

Similar to the cannonical compute matching of the system class, this creates a lookup table mapping each atom in a system class to the index of the atom in a rdkit system.

  • sys (BigDFT.Systems.System) – the bigdft system.

  • bsys (rdkit.Chem.rdchem.Mol) – the rdkit version of the system.

  • check_matching (bool) – if set to True, this will raise an error if we can’t match all of the atoms in the system.


a mapping from a system to indices in the atom list. If

an atom is not in the list, an index value of -1 is assigned.

Return type:


rdkit_visualize(sys, colordict=None, format='SVG')[source]

Visualize a molecule and its fragments using RDKit.

  • sys (BigDFT.Systems.System) – the system to visualize.

  • colordict (dict) – a dictionary mapping fragments to colors.

  • format (str) – either SVG or Cairo.


the image to display. If it’s SVG use SVG(result), Cairo Image(result).

Return type: